package nbcp.model

import nbcp.base.comm.Require
import org.apache.commons.codec.digest.DigestUtils
import nbcp.base.extend.*
import nbcp.base.utils.CodeUtil
import java.time.Duration
import java.time.LocalDateTime


//App 端使呼叫微信支付使用的数据
open class WxPaySignData(
        @Require
        var appId: String,

        @Require
        var partnerid: String, //商户号。
        @Require
        var prepay_id: String
) {
    private var timeStamp: Long = Duration.between("1970-01-01".AsLocalDateTime(), LocalDateTime.now()).seconds
    @Require
    var `package`: String = "Sign=WXPay"
    private var nonceStr: String = CodeUtil.getCode().Slice(0, 32)
    private var signType: String = "MD5"
    var sign = "";
}

